package com.feicheng.house.result;

import com.alibaba.fastjson.JSONObject;

public class ResultInfo extends JSONObject {

	private static final long serialVersionUID = -1412532553323522836L;

	private ResultInfo() {
        this.put("STATUS", "SUCCESS");
    }

    private ResultInfo(Object data) {
        this.put("STATUS", "SUCCESS");
        this.put("DATA", data);
    }

    private ResultInfo(String status, String message) {
        this.put("STATUS", status);
        this.put("MESSAGE", message);
    }


    public static ResultInfo success() {
        return new ResultInfo();
    }

    public static ResultInfo success(Object data) {
        return new ResultInfo(data);
    }

    public static ResultInfo fail(String message) {
        return new ResultInfo("FAIL", message);
    }
    
    public static ResultInfo bindingFail(String message) {
        return new ResultInfo("BINDING_FAIL", message);
    }

    public static ResultInfo loginFail() {
        return new ResultInfo("LOGIN_FAIL", null);
    }

    public static ResultInfo error(String message) {
        return new ResultInfo("ERROR", "");
    }
}